import request from 'utils/request'

/*
    购物车相关api
*/
let config = {
  headers: {
    'Content-Type': 'multipart/form-data'  //之前说的以表单传数据的格式来传递fromdata
  }
};

//加入购物车
export const addShopBuy = params => request.post("/p/cart/add", params)


//购物车列表
export const shopCart = params => request.post("/p/cart/list", params)


//更改购物车选中状态(单选)
export const changeBasketSts = (params) => request.post("/p/cart/changeStatus", params)


//批量更改购物车选中状态(多选)
export const batchChgBasketSts = params => request.post("/p/cart/batch/changeStatus", params)


//查看获取商品所有sku选择
export const selectSkus = params => request.post("/p/cart/skuList", params)


//删除购物车数据
export const deleteShopCart = params => request.post("/p/cart/delete", params)


//批量删除购物车商品
export const deleteShopCarts = params => request.post("/p/cart/batchDeletShopCart", params)


//更改购物车数量
export const changeShopCartNum = params => request.post("/p/cart/updateCount", params)


//清空购物车失效商品
export const clearInvalid = () => request.get("/p/clearInvalid")


//更改购物车中商品选中的sku
export const changeSelectedSku = params => request.post("/p/cart/updateSku", params)


//用户的购物车商品数
export const cartCount = params => request.post("/cart/count", params)
